package com.lockmem.DB;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import android.util.Log;

public class Ebbinghaus {
	public static String tag = "Ebbinghaus";

	public static String getNextVisitDate(int times) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm");
		Calendar next = Calendar.getInstance();
		switch (times) {
		case 1:
			next.add(Calendar.MINUTE, 5);
			break;
		case 2:
			next.add(Calendar.MINUTE, 30);
			break;
		case 3:
			next.add(Calendar.HOUR, 12);
			break;
		case 4:
			next.add(Calendar.DAY_OF_YEAR, 1);
			break;
		case 5:
			next.add(Calendar.DAY_OF_YEAR, 2);
			break;
		case 6:
			next.add(Calendar.DAY_OF_YEAR, 4);
			break;
		case 7:
			next.add(Calendar.DAY_OF_YEAR, 7);
			break;
		case 8:
			next.add(Calendar.DAY_OF_YEAR, 15);
			break;
		case 9:
			next.add(Calendar.MONTH, 1);
			break;
		case 10:
			next.add(Calendar.MONTH, 3);
			break;
		case 11:
			next.add(Calendar.MONTH, 6);
			break;
		case 12:
			return null;
		default:
			try {
				throw new Exception("Ebbinghaus Get Next Time fail");
			} catch (Exception e) {
				// TODO Auto-generated catch block
				Log.v(tag, e.toString());
			}
		}
		return sdf.format(next.getTime());
	}
}
